﻿using System;
using System.IO;
using SEXY;
using UnityEngine;

namespace Character
{
	// Token: 0x0200019B RID: 411
	public class ColorParameter_Hair : ColorParameter_Base
	{
		// Token: 0x06000AD1 RID: 2769 RVA: 0x0003E758 File Offset: 0x0003C958
		public ColorParameter_Hair()
		{
		}

		// Token: 0x06000AD2 RID: 2770 RVA: 0x0003E7C0 File Offset: 0x0003C9C0
		public ColorParameter_Hair(Color mainColor, Color cuticleColor, float cuticleExp, Color fresnelColor, float fresnelExp)
		{
			this.mainColor = mainColor;
			this.cuticleColor = cuticleColor;
			this.cuticleExp = cuticleExp;
			this.fresnelColor = fresnelColor;
			this.fresnelExp = fresnelExp;
		}

		// Token: 0x06000AD3 RID: 2771 RVA: 0x0003E850 File Offset: 0x0003CA50
		public ColorParameter_Hair(ColorParameter_Hair copy)
		{
			this.mainColor = copy.mainColor;
			this.cuticleColor = copy.cuticleColor;
			this.cuticleExp = copy.cuticleExp;
			this.fresnelColor = copy.fresnelColor;
			this.fresnelExp = copy.fresnelExp;
		}

		// Token: 0x06000AD4 RID: 2772 RVA: 0x0003E8F4 File Offset: 0x0003CAF4
		public override COLOR_TYPE GetColorType()
		{
			return COLOR_TYPE.HAIR;
		}

		// Token: 0x06000AD5 RID: 2773 RVA: 0x0003E8F8 File Offset: 0x0003CAF8
		public override void Save(BinaryWriter writer)
		{
			base.Save_ColorType(writer);
			base.WriteColor(writer, this.mainColor);
			base.WriteColor(writer, this.cuticleColor);
			writer.Write(this.cuticleExp);
			base.WriteColor(writer, this.fresnelColor);
			writer.Write(this.fresnelExp);
		}

		// Token: 0x06000AD6 RID: 2774 RVA: 0x0003E94C File Offset: 0x0003CB4C
		public override bool Load(BinaryReader reader, CUSTOM_DATA_VERSION version)
		{
			if (version < CUSTOM_DATA_VERSION.DEBUG_04)
			{
				base.ReadColor(reader, ref this.mainColor);
				return true;
			}
			COLOR_TYPE color_TYPE = ColorParameter_Base.Load_ColorType(reader, version);
			if (color_TYPE != this.GetColorType())
			{
				GlobalData.Debug_LogError("颜色类型不同");
			}
			base.ReadColor(reader, ref this.mainColor);
			base.ReadColor(reader, ref this.cuticleColor);
			this.cuticleExp = reader.ReadSingle();
			base.ReadColor(reader, ref this.fresnelColor);
			this.fresnelExp = reader.ReadSingle();
			return true;
		}

		// Token: 0x06000AD7 RID: 2775 RVA: 0x0003E9D0 File Offset: 0x0003CBD0
		public void FromSexyData(HSColorSet colorSet)
		{
			this.mainColor = colorSet.rgbaDiffuse;
			this.cuticleColor = colorSet.rgbSpecular;
			this.fresnelColor = colorSet.rgbSpecular;
			this.cuticleExp = 6f;
			this.fresnelExp = 0.3f;
		}

		// Token: 0x06000AD8 RID: 2776 RVA: 0x0003EA0C File Offset: 0x0003CC0C
		public override void SetToMaterial(Material material)
		{
			material.color = this.mainColor;
			material.SetColor(CustomDataManager._CuticleColor, this.cuticleColor);
			material.SetFloat(CustomDataManager._CuticleExp, this.cuticleExp);
			material.SetColor(CustomDataManager._FrenelColor, this.fresnelColor);
			material.SetFloat(CustomDataManager._FrenelExp, this.fresnelExp);
		}

		// Token: 0x04000ACA RID: 2762
		public Color mainColor = Color.black;

		// Token: 0x04000ACB RID: 2763
		public Color cuticleColor = new Color(0.75f, 0.75f, 0.75f);

		// Token: 0x04000ACC RID: 2764
		public float cuticleExp = 6f;

		// Token: 0x04000ACD RID: 2765
		public Color fresnelColor = new Color(0.75f, 0.75f, 0.75f);

		// Token: 0x04000ACE RID: 2766
		public float fresnelExp = 0.3f;
	}
}
